using MicroMsg.Network;
using System;
namespace MicroMsg.Scene.Voice
{
	public class UploadVoiceContextMgr : ContextMgrBase<UploadVoiceContext>
	{
		private const string TAG = "UploadVoiceContextMgr";
		public static UploadVoiceContextMgr gUpVoiceContextMgr;
		public static UploadVoiceContextMgr getInstance()
		{
			if (UploadVoiceContextMgr.gUpVoiceContextMgr == null)
			{
				UploadVoiceContextMgr.gUpVoiceContextMgr = new UploadVoiceContextMgr();
			}
			return UploadVoiceContextMgr.gUpVoiceContextMgr;
		}
		public UploadVoiceContext findByClientMsgID(string clientMsgID)
		{
			UploadVoiceContext result;
			lock (this.mQueueLock)
			{
				if (this.mContextQueue.isEmpty())
				{
					result = null;
				}
				else
				{
					for (ListNode next = this.mContextQueue._head._next; next != null; next = next._next)
					{
						UploadVoiceContext uploadVoiceContext = next._obj as UploadVoiceContext;
						if (uploadVoiceContext.mClientMsgId.Equals(clientMsgID))
						{
							result = uploadVoiceContext;
							return result;
						}
					}
					result = null;
				}
			}
			return result;
		}
	}
}
